/*************************************************
* Title：TinyToolKit
* Author：Opportunity 
* Discribe：自定义编辑器扩展基类
* CreateTime：2020-04-05 18:52:29
* Version：1.0
* Modify Recoder：
*************************************************/
using UnityEngine;
using UnityEditor;

namespace TinyToolKitEditor
{
    public class EditorBase:Editor
    {
        protected UnityEngine.Object monoScript;

        protected virtual void OnEnable()
        {
            this.monoScript = MonoScript.FromMonoBehaviour(target as MonoBehaviour);
        }

        public override void OnInspectorGUI()
        {
            DrawMonoScript();
        }

        protected void DrawMonoScript()
        {
            EditorGUI.BeginDisabledGroup(true);
            EditorGUILayout.ObjectField("Script", monoScript, typeof(MonoScript), true);
            EditorGUI.EndDisabledGroup();
        }
    }
}
